﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

using CrossRoadNS.ViewModels;

namespace CrossRoadNS.Views
{
    /// <summary>
    /// Interaction logic for MainView.xaml
    /// </summary>
    public partial class MainView : Window
    {
        MainViewModel _viewModel;

        public MainView()
        {
            InitializeComponent();

            _viewModel = new MainViewModel();
            this.DataContext = _viewModel;
        }

        private void InitButton_Click(object sender, RoutedEventArgs e)
        {
            _viewModel.Init();
            cruc.Refresh();

            InitButton.IsEnabled = false;
            TimerButton.IsEnabled = true;
        }

        private void TimerButton_Click(object sender, RoutedEventArgs e)
        {
            _viewModel.StartStop();
            TimerButton.Content = _viewModel.timer.Enabled ? "Stop" : "Start";
        }
    }
}
